1.2.3.5. alpha.cplusplus.MismatchedIterator (C++)
Check for use of iterators of different containers where iterators of the same container are expected.
Examples:
void bad_insert3(std::vector &v1, std::vector &v2) { v2.insert(v1.cbegin(), v2.cbegin(), v2.cend()); // warn: container accessed // using foreign // iterator argument v1.insert(v1.cbegin(), v1.cbegin(), v2.cend()); // warn: iterators of // different containers // used where the same // container is // expected v1.insert(v1.cbegin(), v2.cbegin(), v1.cend()); // warn: iterators of // different containers // used where the same // container is // expected }